package cn.ecnu.service.impl;


import cn.ecnu.entity.User;
import cn.ecnu.mapper.UserMapper;
import cn.ecnu.service.LoginService;
import cn.ecnu.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class LoginServiceImpl implements LoginService {


    private UserMapper mapper;

    @Autowired
    public LoginServiceImpl(UserMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public User getUserByNameOrPhone(UserVo userVo) {
        return mapper.getUserByField(userVo.getField());
    }

    @Override
    public User getUserByPhone(String phone) {
        return mapper.getUserByPhone(phone);
    }
}
